import { createContext, useContext } from 'react';
import SearchPageStore from 'store/SearchPageStore';
import OrgReposContainerStore from 'store/SearchPageStore/OrgReposContainerStore';
import SearchContainerStore from 'store/SearchPageStore/SearchContainerStore';

type ISearchPageStoreContext = {
    searchPage: SearchPageStore;
    orgReposContainer: OrgReposContainerStore;
    searchContainer: SearchContainerStore;
};

export const SearchPageStoreContext = createContext<ISearchPageStoreContext | null>(null);

export function useSearchPageStoreContext(): ISearchPageStoreContext {
    return useContext(SearchPageStoreContext) as ISearchPageStoreContext;
}
